pragma License (GPL);
--
-- drk-bigint-test.adb
--
-- Copyright (C) 2012 - Thibault BUREL
--
-- This file is part of DRK.BigRat.
--
-- DRK.BigRat is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- DRK.BigRat is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with DRK.BigRat.  If not, see <http://www.gnu.org/licenses/>
--
with AUnit.Assertions; use AUnit.Assertions;

with DRK.BigInt.IO;

package body DRK.BigInt.Test is

   use AUnit.Test_Suites;

   function Name (T : BigInt_Test) return Message_String
   is
      pragma Warnings(Off, T);
   begin
      return Format ("DRK.BigInt");
   end Name;

   -- Test Routines:
   procedure Add_01    (T : in out Test_Cases.Test_Case'Class) is separate;

   procedure Equals_01 (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Equals_02 (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Equals_03 (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Equals_04 (T : in out Test_Cases.Test_Case'Class) is separate;

   procedure Less_01   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Less_02   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Less_03   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Less_04   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Less_05   (T : in out Test_Cases.Test_Case'Class) is separate;

   procedure Minus_01   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure Minus_02   (T : in out Test_Cases.Test_Case'Class) is separate;

   procedure More_01   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure More_02   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure More_03   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure More_04   (T : in out Test_Cases.Test_Case'Class) is separate;
   procedure More_05   (T : in out Test_Cases.Test_Case'Class) is separate;

   procedure Mul_01    (T : in out Test_Cases.Test_Case'Class) is separate;

   procedure Register_Tests (T: in out BigInt_Test)
   is
      use AUnit.Test_Cases.Registration;
   begin
      Register_Routine (T, Equals_01'Access, "Equals_01");
      Register_Routine (T, Equals_02'Access, "Equals_02");
      Register_Routine (T, Equals_03'Access, "Equals_03");
      Register_Routine (T, Equals_04'Access, "Equals_04");

      Register_Routine (T, Less_01'Access  , "Less_01");
      Register_Routine (T, Less_02'Access  , "Less_02");
      Register_Routine (T, Less_03'Access  , "Less_03");
      Register_Routine (T, Less_04'Access  , "Less_04");
      Register_Routine (T, Less_05'Access  , "Less_05");

      Register_Routine (T, More_01'Access  , "More_01");
      Register_Routine (T, More_02'Access  , "More_02");
      Register_Routine (T, More_03'Access  , "More_03");
      Register_Routine (T, More_04'Access  , "More_04");
      Register_Routine (T, More_05'Access  , "More_05");

      Register_Routine (T, Add_01'Access   , "Add_01");

      Register_Routine (T, Mul_01'Access   , "Mul_01");

      Register_Routine (T, Minus_01'Access  , "Minus_01");
      Register_Routine (T, Minus_02'Access  , "Minus_02");

   end Register_Tests;

   -- Statically allocate test suite:
   Result : aliased Test_Suite;

   --  Statically allocate test cases:
   Test_1 : aliased BigInt_Test;

   function Suite return Aunit.Test_Suites.Access_Test_Suite
   is
   begin
      Add_Test (Result'Access, Test_1'Access);
      return Result'Access;
   end Suite;

end DRK.BigInt.Test;
